import React from 'react'
import { useNavigate } from 'react-router-dom'

function My() {
    let nav = useNavigate()
  const dd = () => {
    localStorage.setItem('token', Math.random() * 100)
    nav('/home')
  }
  return (
    <div>
      <button onClick={() => dd()}>登录</button>
    </div>
  )
}

export default My
